<template>
  <div class="comp-home-life">
    <div class="content" :class="[index==0 && 'content1']" v-for="(item,index) in intro.life" :key="index">
      <el-row class="block block1" :gutter="20" v-if="index == 0">
        <el-col :xl="12" :lg="12" :md="12" :sm="24" :xs="24" class="text">
          <h4>{{item.title}}</h4>
          <p>{{item.desc}}</p>
        </el-col>
        <el-col :xl="12" :lg="12" :md="12" :sm="24" :xs="24" class="img">
          <el-image :src="item.imgUrl" :alt="item.title" lazy />
        </el-col>
      </el-row>
      <el-row class="block" :gutter="20" v-if="index == 1">
        <el-col :xl="12" :lg="12" :md="12" :sm="24" :xs="24" class="img">
          <el-image :src="item.imgUrl" :alt="item.title" lazy />
        </el-col>
        <el-col :xl="12" :lg="12" :md="12" :sm="24" :xs="24" class="text">
          <h4>{{item.title}}</h4>
          <p>{{item.desc}}</p>
        </el-col>
      </el-row>
    </div>
  </div>
</template>

<script setup>
const props = defineProps({
  data: {
    type: Object,
    default: () => { }
  }
})

const intro = props.data
</script>

<style lang="scss" scoped>
.comp-home-life {
  .content {
    padding: 20px 5%;
    .block {
      display: flex;
      justify-content: center;
      align-items: center;
      color: #666;
      margin-bottom: 30px;
      .iconfont {
        font-size: 100px;
        color: #0059b2;
        margin-right: 10px;
      }
      .text {
        text-align: center;
      }
      .img {
        text-align: center;
      }
      h4 {
        font-size: 24px;
        margin-top: 25px;
      }
      p {
        font-size: 16px;
        line-height: 25px;
      }
    }
  }
  .content1 {
    background: #fff;
  }
}
</style>